package learnkotlin

import kotlin.jvm.JvmStatic

object KotlinDemo5 {
    @JvmStatic
    fun main(args: Array<String>) {

        val cellPhone = CellPhone()
        cellPhone.brand = "Apple"
        cellPhone.price = 9999.9
        println("cellPhone(brand=${cellPhone.brand},price=${cellPhone.price})")

        printParams(100)
    }

    /**
     * 字符串内嵌表达式  ${}
     */

    class CellPhone {
        var brand = ""
        var price = 0.0
    }


    /**
     * ==============给函数设定默认值
     */

    fun printParams(num: Int, str: String = "hello") {
        println("num is ${num}, str is ${str}")
    }
}